<script setup lang="ts">
import "vant/es/toast/style";
import type { UserType } from "@/models/user";

withDefaults(defineProps<{ userList: UserType[] }>(), {
  userList: [],
});
</script>

<template>
  <van-card
    :tag="user.gender === 0 ? '女' : '男'"
    :desc="user.profile"
    :title="`${user.username} (${user.planetCode})`"
    :thumb="user.avatarUrl"
    v-for="user in userList"
    :key="user.id"
  >
    <template #tags>
      <van-tag
        v-for="tag in JSON.parse(user.tags)"
        :key="tag"
        plain
        type="primary"
        style="margin: 8px 8px 0 0"
        >{{ tag }}
      </van-tag>
    </template>
    <template #footer>
      <van-button size="mini">联系我</van-button>
    </template>
  </van-card>
</template>

<style scoped></style>
